package com.opeartion.service.impl;

import com.opeartion.dao.GoodsMapper;
import com.opeartion.pojo.FindGoods;
import com.opeartion.pojo.Goods;
import com.opeartion.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author sanshi
 * @version 1.0
 * @data 2020/6/5-9:27
 */

@Service
@SuppressWarnings( value = "all")
public class GoodsServiceImpl implements GoodsService {
    @Autowired
   private GoodsMapper goodsMapper;

    @Override
    public List<Goods> goodsList() {
        return goodsMapper.goodsList();
    }

    @Override
    public List<Goods> goodsList(@RequestBody FindGoods findGoods) {
        Map map = new HashMap();
        map.put("sn",findGoods.getSn());
        map.put("name",findGoods.getName());
        map.put("storename",findGoods.getStorename());
        map.put("categoryname",findGoods.getCategoryname());
        List<Goods> goods = goodsMapper.goodsList(map);
        return goods;
    }

    @Override
    public void UpdateGood(int status, int id) {
        goodsMapper.UpdateGood(status,id);
    }
}
